package com.wxmit.ot.base.core;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wxmit.ot.gen.domain.GenGroup;
import org.apache.ibatis.annotations.Param;

/**
 * BaseServiceImpl
 * @author huangxiong
 * @version V1.0
 * @date 2023/2/22 10:33
 */
public abstract class OtBaseServiceImpl<M extends BaseMapper<T>,T> extends ServiceImpl<M,T> implements IService<T> {


    public Page<T> listPage(PageDTO<T> pageDTO) {
        LambdaQueryWrapper<T> lambdaQuery = getLambdaQuery();
        processPageDTO(pageDTO);
        return baseMapper.selectPage(pageDTO.getPage(),lambdaQuery);
    }


    protected LambdaQueryWrapper<T> getLambdaQuery(){
        return new LambdaQueryWrapper<T>();
    }
    protected void processPageDTO(PageDTO<T> pageDTO){
        //DO NOTHING ...
    }

}
